
function ws_growl(data) {
	var json = $.parseJSON(data);
	var src = json.ConnectedLineNum;
	var dst = json.CallerIDNum;
   
	// src = '13380365162';
	
	regex = /^(\d+)$/;
	if (!regex.test(src) || !regex.test(dst)) {
		return;
	}
   
	var body = { };
	body.cdr = 'ns_sip';
	body.number = src;
	
	$.getJSON('tel.php?do=Cdr.ajax_number', body, function(json) {
		// alert($.toJSON(json));
		if (json.t == 'exten') {
			// emp(json.id);
			var title = json.name + "来电 " + src;
		} else if (json.t == 'emp') {
			// emp(json.id);
			var title = json.name + "来电 " + src;
		} else if (json.t == 'contact') {
			
			var id = json.id;
			var info = json.info;
			var info_id = json.info_id;
			
			var c1 = 'contact.php?do=Customer.view&id=' + info_id;
			var c2 = 'contact.php?do=Supplier.view&id=' + info_id;
			
			if (info == 1) {
				title = "'客户信息来电 " + src;
				// Common.dialog_view_(c1, title, '650x420');
			} else {
				title = "供应商来电 "  + src;
				// Common.dialog_view_(c2, title, '650x420');
			}
		} else {
			title = "来电 "  + json.s;
		}
		
		$.jGrowl(title, { life: 12000 });

		return false;
	});
}
